From feabf353716007833cab18d64499180348a5c22a Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Tue, 2 Feb 2016 18:50:58 +0100 Subject: [PATCH] notebook: Do not reorder tabs after a grab notify if there isn't an ongoing reorder operation This broke in f535251507a6a0af68aed6348ae80cbdac9b1f4a that removed during_reorder in favor of using the current operation, but removed the check from gtk_notebook_stop_reorder(). --- gtk/gtknotebook.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index ca665da20a..a4d97ed1ec 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3013,24 +3013,27 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook) if (page->reorderable || page->detachable) { - gint old_page_num, page_num, i; - GList *element; + if (priv->operation == DRAG_OPERATION_REORDER) + { + gint old_page_num, page_num, i; + GList *element; - element = get_drop_position (notebook); - old_page_num = g_list_position (priv->children, priv->focus_tab); - page_num = reorder_tab (notebook, element, priv->focus_tab); - gtk_notebook_child_reordered (notebook, page); + element = get_drop_position (notebook); + old_page_num = g_list_position (priv->children, priv->focus_tab); + page_num = reorder_tab (notebook, element, priv->focus_tab); + gtk_notebook_child_reordered (notebook, page); - if (priv->has_scrolled || old_page_num != page_num) - { - for (element = priv->children, i = 0; element; element = element->next, i++) + if (priv->has_scrolled || old_page_num != page_num) { - if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num)) - gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position"); + for (element = priv->children, i = 0; element; element = element->next, i++) + { + if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num)) + gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position"); + } + g_signal_emit (notebook, + notebook_signals[PAGE_REORDERED], 0, + page->child, page_num); } - g_signal_emit (notebook, - notebook_signals[PAGE_REORDERED], 0, - page->child, page_num); } priv->has_scrolled = FALSE; -- 2.30.2